input = "pwwkew"


def lnr(s):
    l = 0
    val = ""
    ml = 0
    occured = set()
    for r in range(len(s)):
        cur = s[r]
        while cur in occured:
            occured.remove(s[l])
            l += 1
        occured.add(cur)
        if r - l + 1 > ml:
            val = s[l:r + 1]
            ml = r - l + 1

    return val


print(lnr(input))
